<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>推荐材料</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<style>
		*{
			margin:0;
			padding:0;
		}
		body{
			background:#f2f2f2;
		}
			.main{
				padding:0.2rem;
				height:auto;
				font-size: 0.3rem;
			}
			.little_size{
				font-size: 0.2rem;
			}
			.red{
				color:red;
			}
			.main p{
				width:100%;
				height:0.5rem;
			}
			.right{
				float: right;
			    display: inline-block;
			    width: 1rem;
			    height: 100%;
			    text-align: center;
			}
			.content{
				width:100%;
				height:auto;
				background:#fff;
			}
			ul li{
				list-style: none;
				width:100%;
				height:1rem;
				border-bottom: 1px solid silver;
			}
			a{
				text-decoration:none;
				display:block;
				/*width:100%;*/
				height:100%;
				float: left;
				
			}
			img{
				display:block;
				width:0.75rem;
				height:0.51rem;
				float:left;
				margin:0.25rem 0.1rem 0 0;	
			}
			span{
				display: inline-block;
				width:5.5rem;
				white-space: nowrap;
				overflow:hidden;
			    text-overflow:ellipsis;
				line-height: 1rem;
			}
			i{
				font-style: normal;
			}
		</style>
	</head>
	<body>
		<div class='main'>
			
			<ul class='content'>
				
			</ul>
		</div>
		
		<script type="text/javascript" src="../js/jquery-1.11.0.js" ></script>
		<script type="text/javascript" src="../js/aikxian-common.js?id=0001" ></script>
		<script type="text/javascript" src="../js/common.js" ></script>
		<script type="text/javascript" src="../js/rem.js" ></script>
		<script type="text/javascript" src="../js/Base64.min.js" ></script>
		<script type="text/javascript" src="../js/touch.js" ></script>
		<script>
			$(window).load(function(){
				
				//====rowId传空；
				var prodId=$.getUrlParam('prodId');
				var userId=$.getUrlParam('userId');
				var type=$.getUrlParam('type');
				var str="{'prodId':'"+prodId+"','type':'"+type+"','rowId':''}";
//				var str="{'prodId':'PI000000000616','rowId':''}";
				var interFace='';
				if(type==10){
					//合同
					interFace="get_product_pact";
					$('title').html('产品合同');
				}else if(type==11){
					//材料
					interFace="get_product_groom";
					$('title').html('推荐材料');
				}else if(type==1){
					//1 PPT
					interFace="get_product_train";
					$('title').html('PPT');
				}else if(type==2){
					 //2 录音
					interFace="get_product_train";
					$('title').html('录音');
				}else if(type==3){
					 //3 视频
					interFace="get_product_train";
					$('title').html('视频');
				}else if(type==4){
					//4 Q&A
					interFace="get_product_train";
					$('title').html('Q&A');
				}else if(type==5){
					// 5 一页通
					interFace="get_product_train";
					$('title').html('一页通');
				}else if(type==6){
					 //6 亮点提炼
					interFace="get_product_train";
					$('title').html('亮点提炼');
				}else if(type==7){
					 //7 案例集锦
					interFace="get_product_train";
					$('title').html('投资推介书');
				}else if(type==8){
					//8 相关软文 
					interFace="get_product_train";
					$('title').html('相关软文');
				}
				str = Base64.encode(str);
				jQuery(function(){
					jQuery.ajax({
						url:tuijian_material,
						type:"post",
						dataType:"text",
						data:{commonURL:tuijian_material,"opName":interFace,'param':str,'osFlag':'5'},
						async:false,
						success:function(serverinfo){
							console.log(serverinfo);
							var Data=decodeURI(Base64.decode(serverinfo));
							Data=JSON.parse(Data);
							if(Data.retCode==0){
								console.log(Data.content);
								if(Data.content){
									if(Data.content.length!=0){
										for(var i=0;i<Data.content.length;i++){
											var $li=$('<li name='+Data.content[i].value+'></li>');
											var $a=$('<a class="red" href="###"></a>')
											var $img=$('<img src="'+Data.content[i].type+'"/>');
											var $span=$('<span class="little_size">'+Data.content[i].title+'</span>')
											var $checkbox=$('<div class="checkPARENT" style="width:0.7rem;height:100%;float:right;text-align: center;line-height:1rem;"></div>');
											$li.append($img);
											$a.append($span);
											$li.append($checkbox);
											$li.append($a);
											$('.content').append($li);
										}
										
										//点击弹出连接
										$("li").each(function(){
											$(this).click(function(){
												//判断客户端
												var href=$(this).attr('name');
												
												//if (navigator.userAgent.toLowerCase().match(/android/i) == "android") {
													//window.location.href=href;
												//}else{
													window.location.href=href;
													//window.webkit.messageHandlers.AppModel.postMessage({title: '详情', body: 'objc:///linkTo:'+href});
												//}
												

											})
										})
										
									}else{
										$(".main").html('后台小伙伴暂未上传');
										$(".main").css({"text-align":"center","line-height":"4rem","color":"#666","font-size":"0.5rem"});
									}
								}else{
									$(".main").html('后台小伙伴暂未上传');
									$(".main").css({"text-align":"center","line-height":"4rem","color":"#666","font-size":"0.5rem"});
								}
								
							
//								
							}else{
								$(".main").html('暂无数据')
							};
							
							
							
						}
					});
				});
				
			//====		
	});
		</script>
	</body>
</html>
